package sword_to_1;

public class LeeCode_15 {
    public static void main(String[] args) {

    }
    private static int hammingWeight(int n) {
        int ans = 0;
        while (n != 0){
            if ((n & 1) != 0){
                ans++;
            }
            n >>>= 1;
        }
        return ans;
    }
}
